﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace jnagr.Web.Controls
{
    public partial class spet : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {                
                string umenu = getMenu();                
                if (!umenu.Contains("01s1"))
                {
                    Panel1.Visible = false;
                }
                if (!umenu.Contains("01s2"))
                {
                    Panel2.Visible = false;
                }
                if (!umenu.Contains("01s3"))
                {
                    Panel3.Visible = false;
                }
                if (!umenu.Contains("01s4"))
                {
                    Panel4.Visible = false;
                }
                if (!umenu.Contains("01s5"))
                {
                    Panel5.Visible = false;
                }
                if (!umenu.Contains("01s6"))
                {
                    Panel6.Visible = false;
                }
            }
        }
        public string getMenu()
        {
            string umenu = "";
            if (Session["user"] != null)
            {
                DataTable dt = Session["user"] as DataTable;
                if (dt != null)
                {
                    umenu = dt.Rows[0]["umenu"].ToString();
                }
            }
            return umenu;
        }
    }
}